home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol A-4
/
(Vol A-4) Vol. A4.iso
/
Games
/
the-kitchen-of-doom.swf
/
scripts
/
frame_21
/
DoAction.as
Wrap
Text File
|
2008-03-14
|
4KB
|
143 lines
function mute()
{
_global.masterVolume.setVolume(0);
}
function unMute()
{
_global.masterVolume.setVolume(restoreVolume);
}
function toggleButtons()
{
if(buttonsEnabled)
{
playButtonInst.enabled = false;
instructButtonInst.enabled = false;
hiscoresButtonInst.enabled = false;
sendButtonInst.enabled = false;
buttonsEnabled = false;
}
else
{
playButtonInst.enabled = true;
instructButtonInst.enabled = true;
hiscoresButtonInst.enabled = true;
sendButtonInst.enabled = true;
buttonsEnabled = true;
}
}
function startDemo()
{
_global.sfxTitleMusic.stop();
gameMode = MODE_PLAYDEMO;
gotoAndStop("Game Running");
play();
}
stop();
_quality = "HIGH";
StrTable.populate();
if(sysInfoSent != true)
{
StatsTrackerInst.SendGameLaunched(3);
StatsTrackerInst.SendSystemInfo(3);
sysInfoSent = true;
}
TimerInst.Reset();
TimerInst.Start();
MODE_PLAYGAME = 0;
MODE_PLAYDEMO = 1;
MODE_RECORDDEMO = 2;
gameMode = MODE_PLAYGAME;
var mouseListener = new Object();
var i = 0;
while(i < 11)
{
this["bullet" + i]._visible = false;
i++;
}
mouseListener.onMouseMove = function()
{
TimerInst.Reset();
TimerInst.Start();
};
Mouse.addListener(mouseListener);
buttonsEnabled = true;
scoreMode = 0;
sendToFriendMode = 0;
instructionsBoxInst._visible = false;
sendBoxInst._visible = false;
_global.sfxUI = new Sound(createEmptyMovieClip(sfxUIclip,500));
_global.sfxUI.attachSound("uiclick");
_global.sfxUnFreeze = new Sound(createEmptyMovieClip(sfxUnFreeze,504));
_global.sfxUnFreeze.attachSound("baddiewakeup.wav");
_global.sfxFreeze = new Sound(createEmptyMovieClip(sfxFreeze,505));
_global.sfxFreeze.attachSound("turntoice.wav");
_global.sfxFireGun = new Sound(createEmptyMovieClip(sfxFireGun,506));
_global.sfxFireGun.attachSound("heat.wav");
_global.sfxIceGun = new Sound(createEmptyMovieClip(sfxIceGun,507));
_global.sfxIceGun.attachSound("ice.wav");
_global.sfxSprayGun = new Sound(createEmptyMovieClip(sfxSprayGun,508));
_global.sfxSprayGun.attachSound("spray.wav");
_global.sfxCollectGood = new Sound(createEmptyMovieClip(sfxCollectGood,509));
_global.sfxCollectGood.attachSound("collectgood.wav");
_global.sfxCollectBad = new Sound(createEmptyMovieClip(sfxCollectBad,510));
_global.sfxCollectBad.attachSound("collectbad.wav");
_global.sfxHurt = new Sound(createEmptyMovieClip(sfxHurt,511));
_global.sfxHurt.attachSound("hurt.wav");
_global.sfxSpawn = new Sound(createEmptyMovieClip(sfxSpawn,512));
_global.sfxSpawn.attachSound("spawn.wav");
_global.sfxThud = new Sound(createEmptyMovieClip(sfxThud,513));
_global.sfxThud.attachSound("thud.wav");
_global.sfxTitleMusic = new Sound(createEmptyMovieClip(sfxTitleMusic,501));
_global.sfxTitleMusic.attachSound("kitchenofdoomtitle01.wav");
_global.sfxWinMusic = new Sound(createEmptyMovieClip(sfxWinMusic,502));
_global.sfxWinMusic.attachSound("kitchenofdoomwin01.wav");
_global.sfxIngameMusic = new Sound(createEmptyMovieClip(sfxIngameMusic,503));
_global.sfxIngameMusic.attachSound("kitchenofdoom_ingame01.wav");
_global.sfxTitleMusic.start(0,9999);
playButtonInst.onRelease = function()
{
_global.sfxTitleMusic.stop();
_global.sfxUI.start();
gotoAndStop("Game Running");
play();
};
instructButtonInst.onRelease = function()
{
_global.sfxUI.start();
toggleButtons();
instructionsBoxInst._visible = true;
instructionsBoxInst.gotoAndStop(1);
instructionsBoxInst.instAnim.gotoAndPlay(1);
};
hiscoresButtonInst.onRelease = function()
{
_global.sfxUI.start();
toggleButtons();
gotoAndStop("Hiscores");
play();
};
sendButtonInst.onRelease = function()
{
_global.sfxUI.start();
toggleButtons();
sendBoxInst._visible = true;
sendBoxInst.name.text = "";
sendBoxInst.email.text = "";
Selection.setFocus(sendBoxInst.name);
};
onEnterFrame = function()
{
if(TimerInst.getTime() > 10000)
{
if(instructionsBoxInst._visible == false && sendBoxInst._visible == false)
{
startDemo();
}
else
{
TimerInst.Reset();
TimerInst.Start();
}
}
};